<?php
/**
 * Class descript.
 * User: chan
 * Date: 2017/10/20 11:22
 */
namespace app\api\validate;
class Login extends BaseValidate
{
    public function checkLoginParam()
    {
         $this->rule = [
            'mobile' => 'require|isMobile',
            'password' => 'require|isNotEmpty',
        ];
         $this->message = [
            'mobile.require' => '手机号码必填',
            'mobile.isMobile' => '手机号码格式错误',
            'password' => '密码必填',
        ];
        $this->checkParam();
    }
    public function checkRegisterParam()
    {
        $this->rule = [
            'mobile' => 'require|isMobile',
            'passwd' => 'require|isNotEmpty',
            'sex' => 'require|isNotEmpty',
            'height' => 'require|isNotEmpty',
            'weight' => 'require|isNotEmpty',
            'physical_activity' => 'require|isNotEmpty',
            'age' => 'require|isNotEmpty',
            'code' => 'require|isNotEmpty',
            'nickname' => 'require|isNotEmpty',
            'nickname' => 'require|check_string_length'
        ];
        $this->message = [
            'mobile.require' => '手机号码必填',
            'mobile.isMobile' => '手机号码格式错误',
            'passwd' => '密码必填',
            'sex' => '性别必填',
            'height' => '身高必填',
            'weight' => '体重必填',
            'physical_activity' => '运动量参数不为空',
            'age' => '岁数参数不能为空',
            'code' => '验证码必填',
            'nickname' => '参数必填或昵称长度不能超过5个字节',
            'nickname' => '参数必填或昵称长度不能超过5个字节'
        ];
        $this->checkParam();
    }
}